﻿<UserControl x:Class="EasySL.Controls.TagCloud"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="200" Height="200">
    <Grid x:Name="LayoutRoot" Background="White" Width="200" Height="200">
        <Canvas x:Name="RootCanvas" Width="200" Height="200">
            <Path Stroke="#FF00394A" StrokeThickness="1.5" Data="M 3,3 H 3,15 M 3,3 V 3,15 M 3,3 L 15,15"/>
            <Path Opacity="0.3" Stroke="#FF00394A" StrokeThickness="1.5" Data="M 3,3 H 3,15 M 3,3 V 3,15 M 3,3 L 15,15">
                <Path.RenderTransform>
                    <TransformGroup>
                        <RotateTransform Angle="90" CenterX="100" CenterY="100"/>
                    </TransformGroup>
                </Path.RenderTransform>
            </Path>
            <Path Opacity="0.3" Stroke="#FF00394A" StrokeThickness="1.5" Data="M 3,3 H 3,15 M 3,3 V 3,15 M 3,3 L 15,15">
                <Path.RenderTransform>
                    <TransformGroup>
                        <RotateTransform Angle="180" CenterX="100" CenterY="100"/>
                    </TransformGroup>
                </Path.RenderTransform>
            </Path>
            <Path Opacity="0.3" Stroke="#FF00394A" StrokeThickness="1.5" Data="M 3,3 H 3,15 M 3,3 V 3,15 M 3,3 L 15,15">
                <Path.RenderTransform>
                    <TransformGroup>
                        <RotateTransform Angle="270" CenterX="100" CenterY="100"/>
                    </TransformGroup>
                </Path.RenderTransform>
            </Path>
        </Canvas>
    </Grid>
    <UserControl.Resources>
        <ControlTemplate x:Key="CloudItem" TargetType="HyperlinkButton">
            <Grid>
                <Rectangle x:Name="focusBorder" StrokeThickness="1" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Stroke="Red" />
                <ContentControl x:Name="item"  Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" />
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                        <VisualState x:Name="Normal">
                            <Storyboard>
                                <ColorAnimation Storyboard.TargetName="item"
                                        Storyboard.TargetProperty="(Foreground).(SolidColorBrush.Color)" To="#FF00394A" Duration="0" />
                                <ColorAnimation Storyboard.TargetName="focusBorder"
                                        Storyboard.TargetProperty="(Stroke).(SolidColorBrush.Color)" To="#FF00394A" Duration="0" />
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Pressed"/>
                        <VisualState x:Name="MouseOver">
                            <Storyboard>
                                <ColorAnimation Storyboard.TargetName="item"
                                        Storyboard.TargetProperty="(Foreground).(SolidColorBrush.Color)" To="#FFD74E2C" Duration="0" />
                                <ColorAnimation Storyboard.TargetName="focusBorder"
                                        Storyboard.TargetProperty="(Stroke).(SolidColorBrush.Color)" To="#FFD74E2C" Duration="0" />
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Disabled"/>
                    </VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                        <VisualState x:Name="Unfocused">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="focusBorder"
                                                 Storyboard.TargetProperty="StrokeThickness" To="0" Duration="0" />
                            </Storyboard>
                        </VisualState>
                        <VisualState x:Name="Focused">
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="focusBorder"
                                                 Storyboard.TargetProperty="StrokeThickness" To="1" Duration="0" />
                            </Storyboard>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
            </Grid>
        </ControlTemplate>
    </UserControl.Resources>
</UserControl>
